#ifndef ROSTERXML_H
#define ROSTERXML_H

#include <QObject>
#include <QDomDocument>
#include <QTextStream>
#include <QFile>

#include <QDebug>

#include "rosteritemmodel.h"

class RosterXml : public QObject
{
    Q_OBJECT
public:
    explicit RosterXml(QObject *parent = 0);

    bool createRosterXML( QString &xmlFileRoster );
    bool saveRosterXml();

    void addMuc( RosterItemModel *itemRoster );
    void removeMuc( QString &jidRoom );

    void addContact(RosterItemModel *itemRoster);

    QList<RosterItemModel *> getListMuc();
signals:
    
public slots:

private:
    void routineAddTextNode(QDomElement &rootNode, QString &nodeName, QString &textInfo);
    bool itemExists(const QString &bareJid) const;
    void changeGroup( QString &bareJid, QString &newGroup );

    QDomDocument rosterXMLDoc;
    QDomElement rootRoster;
    
    QString nameTagMuc;
    QString rosterXmlFile;

    //QDomElement nodeMuc;
};

#endif // ROSTERXML_H
